<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ～ ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------

// you should use `$router`
/* @var think\Route $router */

$router->group('externalGoods',function () use ($router){

    //商品
    $router->get('goods/remote$', 'catchAdmin\externalGoods\controller\Goods@remote');//远程对比
    $router->post('goods/sync$', 'catchAdmin\externalGoods\controller\Goods@sync');

    //供应商商品管理
    $router->get('goods', 'catchAdmin\externalGoods\controller\Goods@index');
    $router->post('goods', 'catchAdmin\externalGoods\controller\Goods@create');
    $router->put('goods/:id', 'catchAdmin\externalGoods\controller\Goods@update');
    $router->delete('goods/:id', 'catchAdmin\externalGoods\controller\Goods@delete');


    //新闻管理
    $router->get('news', 'catchAdmin\externalGoods\controller\News@index');
    $router->get('news1', 'catchAdmin\externalGoods\controller\News@index1');
    $router->get('news2', 'catchAdmin\externalGoods\controller\News@index2');
    $router->get('news/:id', 'catchAdmin\externalGoods\controller\News@detail');
    $router->put('news/:id', 'catchAdmin\externalGoods\controller\News@update');
    $router->delete('news/:id', 'catchAdmin\externalGoods\controller\News@delete');
    $router->post('news', 'catchAdmin\externalGoods\controller\News@create');

    //回调
    $router->get('notify', 'catchAdmin\externalGoods\controller\Notify@index');//通知日志

    //渠道商商品管理
    $router->get('tenantGoods', 'catchAdmin\externalGoods\controller\TenantGoods@index');//渠道商商品列表
    $router->get('tenantGoods/select', 'catchAdmin\externalGoods\controller\TenantGoods@select');//选择商品
    $router->post('tenantGoods/addSelect', 'catchAdmin\externalGoods\controller\TenantGoods@addSelect');//添加选择的商品
    $router->delete('tenantGoods/:id', 'catchAdmin\externalGoods\controller\TenantGoods@delete');//删除商品
    $router->post('tenantGoods', 'catchAdmin\externalGoods\controller\TenantGoods@create');//创建商品
    $router->put('tenantGoods/:id', 'catchAdmin\externalGoods\controller\TenantGoods@update');//修改商品
    //渠道商订单管理
    $router->get('tenantOrders', 'catchAdmin\externalGoods\controller\TenantOrders@index');//渠道商订单列表
    $router->post('tenantOrders/edit', 'catchAdmin\externalGoods\controller\TenantOrders@edit');//渠道商订单修改&读取

    $router->post('tenantOrders/yfkApply/:id', 'catchAdmin\externalGoods\controller\TenantOrders@yfkApply');//预付卡推送
    $router->post('tenantOrders/downTemplate', 'catchAdmin\externalGoods\controller\TenantOrders@downTemplate');//下载模版
    $router->post('tenantOrders/import', 'catchAdmin\externalGoods\controller\TenantOrders@import');//导入订单
    $router->post('tenantOrders/customsApply/:id', 'catchAdmin\externalGoods\controller\TenantOrders@customsApply');//推送支付单
    $router->post('tenantOrders/xsRefund/:id', 'catchAdmin\externalGoods\controller\TenantOrders@xsRefund');//退款

    $router->post('tenantOrders/createOrder/:id', 'catchAdmin\externalGoods\controller\TenantOrders@createOrder');//候鸟创建订单
    $router->get('tenantOrders/apiOrderDetail/:id', 'catchAdmin\externalGoods\controller\TenantOrders@apiOrderDetail');//候鸟订单详情
    $router->get('tenantOrders/apiOrderDetail_new/:id', 'catchAdmin\externalGoods\controller\TenantOrders@apiOrderDetail_new');//候鸟订单详情

    //菜鸟的
    $router->post('tenantOrders/apiSaleOrder/:id', 'catchAdmin\externalGoods\controller\TenantOrders@apiSaleOrder');//菜鸟交易单下放
    $router->get('tenantOrders/queryOrder/:id', 'catchAdmin\externalGoods\controller\TenantOrders@queryOrder');//菜鸟查询最新订单
    $router->put('tenantOrders/modifyInfo/:id', 'catchAdmin\externalGoods\controller\TenantOrders@modifyInfo');//菜鸟修改身份信息


})->middleware('auth');

//候鸟通知
//$router->get('callback/houniao', 'catchAdmin\externalGoods\controller\Callback@houniao');
$router->post('callback/houniao', 'houniao\Notify@notify');
$router->post('callback/xyb2b', 'xyb2b\Notify@notify');
$router->post('callback/SyncShop', 'houniao\SyncShop@notify');
$router->post('callback/SyncShop1110', 'houniao\SyncShop1110@notify');
$router->post('callback/SyncShop1116', 'houniao\SyncShop1116@notify');
$router->post('callback/SyncShop1122', 'houniao\SyncShop1122@notify');
$router->post('callback/SyncShop1127', 'houniao\SyncShop1127@notify');
$router->post('callback/SyncShop1125', 'houniao\SyncShop1125@notify');
$router->post('callback/xinsheng', 'xinsheng\Notify@notify');
$router->post('callback/cainiao', 'cainiao\Notify@notify');
$router->post('callback/test', 'houniao\Notify@test');


$router->get('getDeviceCode/:id', 'houniao\Notify@getDeviceCode');


//分类
$router->post('externalGoods/category/sync$', 'catchAdmin\externalGoods\controller\Category@sync');//同步数据
$router->get('externalGoods/category', 'catchAdmin\externalGoods\controller\Category@index');//列表-属性树形
$router->post('externalGoods/category/disableCategories', 'catchAdmin\externalGoods\controller\Category@setDisableCategories');//设置禁用分类
$router->get('externalGoods/category/disableCategories', 'catchAdmin\externalGoods\controller\Category@getDisableCategories');//获取禁用分类

$router->post('externalGoods/tenantOrders/import2', 'catchAdmin\externalGoods\controller\TenantOrders@import2');//导入订单
$router->post('externalGoods/tenantOrders/exportOrders', 'catchAdmin\externalGoods\controller\TenantOrders@exportOrders');//导入订单
$router->post('externalGoods/tenantOrders/modifyOrder/:id', 'catchAdmin\externalGoods\controller\TenantOrders@modifyOrder');//导入订单

$router->get('/api/xss/query1', 'catchAdmin\externalGoods\controller\TenantOrders@query1');

$router->post('externalGoods/tenantGoods/addSyncQekjTask', 'catchAdmin\externalGoods\controller\TenantGoods@addSyncQekjTask');//渠道商商品列表
$router->post('externalGoods/tenantGoods/dealSyncQekjTask', 'catchAdmin\externalGoods\controller\TenantGoods@dealSyncQekjTask');//渠道商商品列表
$router->post('externalGoods/tenantGoods/dealSingleGoodsSyncQekj', 'catchAdmin\externalGoods\controller\TenantGoods@dealSingleGoodsSyncQekj');//渠道商商品列表
$router->post('externalGoods/tenantGoods/exportGoods', 'catchAdmin\externalGoods\controller\TenantGoods@exportGoods');//导入订单
$router->get('externalGoods/newNotify', 'catchAdmin\externalGoods\controller\NewNotify@index');//新通知日志
$router->post('externalGoods/notify/triggerGoods', 'catchAdmin\externalGoods\controller\Notify@triggerGoods');//商品通知

//授信消费记录
$router->get('externalGoods/credit', 'catchAdmin\externalGoods\controller\CreditDeduction@index');

//发布&停止
$router->post('externalGoods/news/publish', 'catchAdmin\externalGoods\controller\News@publish');

    //清单表体模板管理
    $router->get('externalGoods/manifest/template/list', 'catchAdmin\externalGoods\controller\ManifestTemplate@list');//获取模板列表
    $router->post('externalGoods/manifest/template/save', 'catchAdmin\externalGoods\controller\ManifestTemplate@save');//保存模板
    $router->post('externalGoods/manifest/template/delete', 'catchAdmin\externalGoods\controller\ManifestTemplate@delete');//删除模板
